package com.tone.ji_volunteer.controller;

import com.tone.ji_volunteer.pojo.Result;
import com.tone.ji_volunteer.pojo.User;
import com.tone.ji_volunteer.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author tone(ang)
 * version 1.0
 */
@RestController
@Slf4j
//@Scope("prototype")
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/participants")
    public Result getAllParticipants(Integer activityId){
        List<String> users =  userService.getAllParticipants(activityId);
        return Result.success(users);
    }
}
